<template>
  <img class="img" :src="name" :style="iconStyle" alt="" />
</template>
<script>
export default {
  props: {
    name: String,
    size: [String, Number],
  },
  computed: {
    iconStyle() {
      let styl = "";
      if (this.size) {
        styl += `width:${this.size}px;height:${this.size}px`;
      }
      return styl;
    },
  },
};
</script>
<style lang="scss" scoped>
.img {
  vertical-align: middle;
}
</style>
